package com.qd.pandaparkflow.bean;

import com.qd.common.panda.domain.entity.rule.BaseRuleDTO;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

/**
 * @author sjk
 */
@Data
@Accessors(chain = true)
@ToString
public class PriceReqVO {

    private String id;

    /**
     * 订单号
     */
    private String orderNo;
    /**
     * 订单开始时间
     */
    private LocalDateTime startTime;
    /**
     * 订单结束时间
     */
    private LocalDateTime endTime;
    /**
     * 规则ID
     */
    private String billRule;
    /**
     * 规则
     */
    private List<BaseRuleDTO> rules;

    public void freeData() {
        this.orderNo = null;
        this.startTime = null;
        this.endTime = null;
        this.billRule = null;
        Optional.ofNullable(rules).ifPresent(List::clear);
    }

}
